export {};
// infer在这里用于提取函数类型的返回值类型。
type ReturnType<T extends (...args: any[]) => any> = T extends (
  ...args: any[]
) => infer R ? R: any;

type ReturnType2<T> = T extends (...args: any[]) => infer R ? R : never;

type Func = (value: number) => string;
// ReturnType<Func> Func的返回值string
const foo: ReturnType2<Func> = "1";

